package org.util;

public class StringProcess {

	public static void main(String[] args) {
		String url = "http://www.baidu.com/flys/demo.html";
		
		String result = url.substring(0,url.lastIndexOf("/")+1);
		
		System.out.println(result);
	}
	
	/**
	 * 验证url是否正确
	 * @param uri
	 * @return
	 */
	
	public static String mosaicUri(String uri,String sonPath){
		
		String result = null;
		try {
			
			result = uri.substring(0,uri.lastIndexOf("/")+1) + sonPath;
			
		} catch (IndexOutOfBoundsException e) {
			
		}finally{
			
		}
		
		return result;
	}
}
